<template>
  <div class="home">
    <el-container style="height:100vh; border: 1px solid #eee">
      <el-aside width="200px" style="background-color: rgb(1,1,1);color:#fff;">
        <div class="aside-logo-box">
          <img src alt />
          <span>众屏监播后台</span>
        </div>
        <MyMenu :menuData="menuData" />
      </el-aside>
      <el-container>
        <el-header style="text-align: right; font-size: 12px">
          <MyHeader />
        </el-header>
        <el-main>
          <router-view />
        </el-main>
      </el-container>
    </el-container>
  </div>
</template>

<script>
// @ is an alias to /src
import MyMenu from '@/components/menu/index'
import MyHeader from '@/components/header/index'
export default {
  name: 'home',
  data () {
    return {
      menuData: [
        {
          menuTxt: '主页',
          onTips: false,
          router: '/index',
          menuChild: []
        },
        {
          menuTxt: '报告',
          onTips: false,
          router: '/report',
          menuChild: []
        },
        {
          menuTxt: '设备',
          router: '/device',
          onTips: false,
          menuChild: []
        },
        {
          menuTxt: '广告',
          router: '/',
          menuChild: [
            {
              menuTxt: '广告数据',
              onTips: false,
              router: '/advertising'
            },
            {
              menuTxt: '广告素材',
              onTips: false,
              router: '/material'
            },
            {
              menuTxt: '新增模板',
              onTips: false,
              router: '/addtemplate'
            }
          ]
        }
      ]
    }
  },
  created () {
    // let adminDta = [
    //   {
    //     menuTxt: '广告主',
    //     router: '/advertisers',
    //     onTips: false,
    //     menuChild: []
    //   },
    //   {
    //     menuTxt: '审核',
    //     router: '/checkAD',
    //     onTips: true,
    //     menuChild: []
    //   }
    // ]
    // if (JSON.parse(sessionStorage.getItem('userinfo')).level == '3') {
    //   adminDta.forEach(element => {
    //     this.menuData.push(element)
    //   })
    // }
  },
  methods: {},
  components: {
    MyMenu,
    MyHeader
  }
}
</script>
<style lang="less">
.home {
  .aside-logo-box {
    padding: 18px 0;
    text-align: center;
  }
}
</style>
